<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script src="js/jquery-3.4.1.min.js"></script>		
	</head>
	<body>
		<!-- 
		 1. 简易的 .click
		 2. bind
		 3. delegate
		 4. on
		 
		 on的事件绑定方式
		 
		 $(selector).on(event,childSelector,data,function)
		 
		 childSelector:委托时才写
		 data 可选
		 
		 -->
		 
		 <ul>
		 	<li>1</li>
		 	<li>2</li>
		 	<li>3</li>
		 	<li>4</li>
		 	<li>5</li>
		 </ul>
		 <br>
		 <input id="btn" type="button" value="新增li">
		 
		 
		 <script>
		 	$(function() {
		 		$("#btn").on("click",function(){
		 			var $li = $("<li>新增的</li>");
		 			$("ul").append($li);
		 		});				
		 	
		 		
		 		$("ul").on("click","li",function(){
		 			$(this).css("background", "red");
		 		});				
		 	
		 	});
		 	
		 </script>
	</body>
</html>
